/**
 * Copyright 1999-2015 dangdang.com.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */

package spring.cloud.tasks.api.vo;

import spring.cloud.tasks.api.domain.TaskConfiguration;
import spring.cloud.tasks.api.utils.BeanUtils;

public class UpdateJobConfigVo {

    private String jobName;
    private String jobClass;
    private Integer shardingTotalCount;
    private String timeZone;
    private String cron;
    private String pausePeriodDate;
    private String pausePeriodTime;
    private String shardingItemParameters;
    private String jobParameter;
    private Integer processCountIntervalSeconds;
    private Boolean failover;
    private String description;
    private Integer timeout4AlarmSeconds;
    private Integer timeoutSeconds;
    private Integer disableTimeoutSeconds;
    private Boolean showNormalLog;
    private String channelName;
    private String jobType;
    private String queueName;
    private Integer loadLevel;
    private Integer jobDegree;
    private Boolean enabledReport;
    private Boolean enabled;
    private String preferList;
    private Boolean onlyUsePreferList;
    private Boolean localMode;
    private Boolean useSerial;
    private String jobMode;
    private String dependencies;

    private Boolean rerun;
    private String upStream;
    private String downStream;

    public TaskConfiguration toJobConfig() {
        TaskConfiguration taskConfiguration = new TaskConfiguration();
        BeanUtils.copyProperties(this, taskConfiguration);
        if (onlyUsePreferList != null) {
            taskConfiguration.setUseDisPreferList(!onlyUsePreferList);
        }
        return taskConfiguration;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobClass() {
        return jobClass;
    }

    public void setJobClass(String jobClass) {
        this.jobClass = jobClass;
    }

    public Integer getShardingTotalCount() {
        return shardingTotalCount;
    }

    public void setShardingTotalCount(Integer shardingTotalCount) {
        this.shardingTotalCount = shardingTotalCount;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public String getPausePeriodDate() {
        return pausePeriodDate;
    }

    public void setPausePeriodDate(String pausePeriodDate) {
        this.pausePeriodDate = pausePeriodDate;
    }

    public String getPausePeriodTime() {
        return pausePeriodTime;
    }

    public void setPausePeriodTime(String pausePeriodTime) {
        this.pausePeriodTime = pausePeriodTime;
    }

    public String getShardingItemParameters() {
        return shardingItemParameters;
    }

    public void setShardingItemParameters(String shardingItemParameters) {
        this.shardingItemParameters = shardingItemParameters;
    }

    public String getJobParameter() {
        return jobParameter;
    }

    public void setJobParameter(String jobParameter) {
        this.jobParameter = jobParameter;
    }

    public Integer getProcessCountIntervalSeconds() {
        return processCountIntervalSeconds;
    }

    public void setProcessCountIntervalSeconds(Integer processCountIntervalSeconds) {
        this.processCountIntervalSeconds = processCountIntervalSeconds;
    }

    public Boolean getFailover() {
        return failover;
    }

    public void setFailover(Boolean failover) {
        this.failover = failover;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getTimeout4AlarmSeconds() {
        return timeout4AlarmSeconds;
    }

    public void setTimeout4AlarmSeconds(Integer timeout4AlarmSeconds) {
        this.timeout4AlarmSeconds = timeout4AlarmSeconds;
    }

    public Integer getTimeoutSeconds() {
        return timeoutSeconds;
    }

    public void setTimeoutSeconds(Integer timeoutSeconds) {
        this.timeoutSeconds = timeoutSeconds;
    }

    public Integer getDisableTimeoutSeconds() {
        return disableTimeoutSeconds;
    }

    public void setDisableTimeoutSeconds(Integer disableTimeoutSeconds) {
        this.disableTimeoutSeconds = disableTimeoutSeconds;
    }

    public Boolean getShowNormalLog() {
        return showNormalLog;
    }

    public void setShowNormalLog(Boolean showNormalLog) {
        this.showNormalLog = showNormalLog;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public String getQueueName() {
        return queueName;
    }

    public void setQueueName(String queueName) {
        this.queueName = queueName;
    }

    public Integer getLoadLevel() {
        return loadLevel;
    }

    public void setLoadLevel(Integer loadLevel) {
        this.loadLevel = loadLevel;
    }

    public Integer getJobDegree() {
        return jobDegree;
    }

    public void setJobDegree(Integer jobDegree) {
        this.jobDegree = jobDegree;
    }

    public Boolean getEnabledReport() {
        return enabledReport;
    }

    public void setEnabledReport(Boolean enabledReport) {
        this.enabledReport = enabledReport;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public String getPreferList() {
        return preferList;
    }

    public void setPreferList(String preferList) {
        this.preferList = preferList;
    }

    public Boolean getOnlyUsePreferList() {
        return onlyUsePreferList;
    }

    public void setOnlyUsePreferList(Boolean onlyUsePreferList) {
        this.onlyUsePreferList = onlyUsePreferList;
    }

    public Boolean getLocalMode() {
        return localMode;
    }

    public void setLocalMode(Boolean localMode) {
        this.localMode = localMode;
    }

    public Boolean getUseSerial() {
        return useSerial;
    }

    public void setUseSerial(Boolean useSerial) {
        this.useSerial = useSerial;
    }

    public String getJobMode() {
        return jobMode;
    }

    public void setJobMode(String jobMode) {
        this.jobMode = jobMode;
    }

    public String getDependencies() {
        return dependencies;
    }

    public void setDependencies(String dependencies) {
        this.dependencies = dependencies;
    }


    public Boolean getRerun() {
        return rerun;
    }

    public void setRerun(Boolean rerun) {
        this.rerun = rerun;
    }

    public String getUpStream() {
        return upStream;
    }

    public void setUpStream(String upStream) {
        this.upStream = upStream;
    }

    public String getDownStream() {
        return downStream;
    }

    public void setDownStream(String downStream) {
        this.downStream = downStream;
    }
}
